<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'announceselect.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<link rel="stylesheet" type="text/css" href="css/common.css">

  </head>
  
  <body>
    <div class="centerdiv">
    	<table class="tablestyle">
    		<tr class="title_font">
    			<td colspan="4">所有书店公告</td>
    		</tr>
    		<tr class="table_title">
    			<th>用户名</th>
    			<th>公告时间</th>
    			<th>标题</th>
    			<th>操作</th>
    		</tr>
    		<s:if test="%{size==0}">
    			<td colspan="4">还没有公告</td>
    		</s:if>
    		<s:else>
    		    <s:iterator value="%{announceList}">
    		    	<tr align="center">
	    		    	<td><s:property value="username"/></td>
	    		    	<td><s:property value="announceTime"/></td>
	    		    	<td><s:property value="title"/></td>
	    		    	<td>
	    		    		<a href="jsp_admin_announcedetail.action?announceId=<s:property value='announceId' />">详情</a>
	    		    		<a href="jsp_admin_announcedelete.action?announceId=<s:property value='announceId' />">删除</a>
	    		    	</td>    		    	
    		    	</tr>
    			</s:iterator>
    		</s:else>
    		<tr>
    			<td colspan="4" align="right">
    				<a href="jsp/admin/announceadd.jsp">添加公告</a>
    			</td>
    		</tr>
    	</table>
    </div>
  </body>
</html>
